<!DOCTYPE html>
<html>
  <head>
    <title>Blog</title>
    <%= csrf_meta_tags %>
    <%= csp_meta_tag %>

    <%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
  </head>

  <body>

  <nav class="navbar navbar-expand-lg navbar-light bg-light">
  <a class="navbar-brand" href="#">Kanon</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
      <%= link_to "Home", root_path, class: "nav-link" %>
      </li>
      <li class="nav-item">
        <div class="nav-link">
         <% unless session[:crrent_user].nil? %>
      Welcome, ✨<%= session[:crrent_user]['username'] %> ✪ ω ✪
      <%= link_to "Logout", logout_path %>
  <% else %>
      not Login,👋 Click <%= link_to "Login" , login_path %>   OR   ☞ <%= link_to "Register" , register_path %>?
  <% end %>
        </div>
      </li>
    </ul>
  </div>
</nav>

    <%= yield %>
  </body>
</html>
